package org.jfsm.demo.ccounter;

public class CntDemo extends CntController {

    CntController controller = new CntController();

    public CntDemo(String args[]) throws Exception {

        if (System.getProperty("java.version").compareTo("1.6") < 0) {
            System.out.println("Use java 1.6 for maximum performance");
        }

        System.out.println("Running on " + Runtime.getRuntime().availableProcessors() + " cpus.");

        if (args.length > 0) {
            controller.numThreads = Integer.valueOf(args[0]);
        }

        if (args.length > 1) {
            controller.logId = args[1];
        } else {
            controller.logId = null;
        }

        controller.start();
    }

    public static void main(String args[]) {
        try {
            new CntDemo(args);

        } catch (Exception e) {
            e.printStackTrace();
            System.exit(1);
        }
    }
}